<style lang="scss" scoped>
.order-list {
  padding: 0 0.2rem;
  .order-box {
    background-color: #ffffff;
    margin: 0.3rem 0;
    .content {
      display: flex;
      padding: 0.3rem;
      border-bottom: 1px solid #eeeeee;
      .img-box {
        display: flex;
        flex-basis: 30%;
      }
      .detail-box {
        display: flex;
        flex-basis: 70%;
        flex-direction: column;
        padding: 0 0.2rem;
        .title {
          font-size: 0.34rem;
          padding-bottom: 0.2rem;
          font-weight: 600;
        }
        .text {
          padding-bottom: 0.1rem;
        }
      }
    }
    .info-box {
      display: flex;
      flex-basis: 100%;
      flex-wrap: wrap;
      padding: 0.3rem;
      font-size: 0.3rem;
    }
  }
}
</style>

<template>
  <div class="order-list">
    <template v-for="item in list">
      <div class="order-box" @click="linkto(item)">
        <div class="content">
          <div class="img-box">
            <van-image width="100%" height="100%" fit="cover" :src="require('@/assets/img/0.png')"/>
          </div>
          <div class="detail-box">
            <p class="title">{{item.name}}</p>
            <p class="text">急救类型：{{item.typeName}}</p>
            <p class="text">
              <span class="van-multi-ellipsis--l2" v-html="item.content"></span>
            </p>
          </div>
        </div>
      </div>
    </template>
  </div>
</template>

<script>

export default {
  name: 'HomeList',
  props: {
    list: {
      type: Array,
      required: true,
      default: []
    }
  },
  methods: {
    linkto({ id }) {
      this.$router.push({
        path: '/firstAidDetail',
        query: { id }
      });
    }
  }
};
</script>